package cn.sanshuilin.kst.system.provider.bean;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @author greenlee
 * @version v1.0
 * @create 创建时间: 2017-12-03 18:13
 * Copyright 2017  by 三水林科技有限公司
 **/
@Entity
@Table(name = "Attitude")
public class Attitude implements Serializable {
    private String id;
    private Integer categoryId;
    private String objId;
    private Timestamp pubDate;
    private String pubMemberId;

    private Member pubMember;
    private String categoryName;
    @Transient
    public Member getPubMember() {
        return pubMember;
    }

    public void setPubMember(Member pubMember) {
        this.pubMember = pubMember;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    @Transient

    public String getCategoryName() {
        return categoryName;
    }

    @Id
    @Column(name = "ID", nullable = false, length = 255)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "CategoryID", nullable = true)
    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    @Basic
    @Column(name = "ObjID", nullable = true, length = 255)
    public String getObjId() {
        return objId;
    }

    public void setObjId(String objId) {
        this.objId = objId;
    }

    @Basic
    @Column(name = "PubDate", nullable = true)
    public Timestamp getPubDate() {
        return pubDate;
    }

    public void setPubDate(Timestamp pubDate) {
        this.pubDate = pubDate;
    }

    @Basic
    @Column(name = "PubMemberID", nullable = true, length = 255)
    public String getPubMemberId() {
        return pubMemberId;
    }

    public void setPubMemberId(String pubMemberId) {
        this.pubMemberId = pubMemberId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Attitude that = (Attitude) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (categoryId != null ? !categoryId.equals(that.categoryId) : that.categoryId != null) return false;
        if (objId != null ? !objId.equals(that.objId) : that.objId != null) return false;
        if (pubDate != null ? !pubDate.equals(that.pubDate) : that.pubDate != null) return false;
        if (pubMemberId != null ? !pubMemberId.equals(that.pubMemberId) : that.pubMemberId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (categoryId != null ? categoryId.hashCode() : 0);
        result = 31 * result + (objId != null ? objId.hashCode() : 0);
        result = 31 * result + (pubDate != null ? pubDate.hashCode() : 0);
        result = 31 * result + (pubMemberId != null ? pubMemberId.hashCode() : 0);
        return result;
    }
}
